﻿namespace Arms.Application.Base.Profiles
{
    using Arms.Domain;
    using AutoMapper;
    using System;

    public class EntityProfile<TSource, TDestination> : Profile
        where TSource : Entity
        where TDestination : EntityDTO
    {
        protected override void Configure()
        {
            this.Map();
        }

        protected virtual IMappingExpression<TSource, TDestination> Map()
        {
            return Mapper.CreateMap<TSource, TDestination>().ForMember(x => x.ActiveState, y => y.MapFrom(z => z.ActiveState.ToString()));
        }
    }
}
